package com.xncoding.design.YuanXing.demo01;

import com.alibaba.fastjson.JSON;

public class Client {
    public static void main(String[] args) {
        int i = 0;
        int MAX_COUNT = 10;
        EventTemplate et = new EventTemplate("邀请函（不变）", "婚嫁生日啥的....（不变部分）");
        Mail mail = new Mail(et);
        while (i < MAX_COUNT) {
            Mail cloneMail = mail.clone();
            cloneMail.setContent("XXX先生（女士）（变化部分）"
                    + mail.getTail());
            cloneMail.setReceiver("每个人的邮箱地址...com（变化部分）");
            sendMail(cloneMail);
            i++;
        }
    }

    public static void  sendMail(Mail mail){
        System.out.println(JSON.toJSONString(mail));
    }
}
